package com.sinothk.lab.test0324validateparam;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class Resume {

    // 前端传入的flag值必须是1或2或3，否则校验失败
    @FlagValidator(values = "1,2,3", groups = C.class, message = "必须是1,2,3")
    private String flag ;

    @NotNull(message = "id不能为空", groups = U.class)
    private Long id;

    @NotNull(message = "名字不能为空", groups = C.class)
    @Length(min = 4, max = 10, message = "name 长度必须在 {min} - {max} 之间", groups = C.class)
    private String name;

    @NotNull(message = "年龄不能为空", groups = C.class)
    @Min(value = 18, message = "年龄不能小于18岁", groups = C.class)
    private Integer age;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }
}

